package bakery.dao;

import java.sql.SQLException;
import java.util.ArrayList;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

import bakery.vo.SubCategoryVO;


public class SubCategoryDAO {

	private SqlMapClientTemplate client;
	
	public SubCategoryDAO(SqlMapClientTemplate client){
		this.client = client;
	}
	
	public void insertSubCategory(SubCategoryVO mvo) throws SQLException{
		client.insert("insertSubCategory", mvo);
	}
	
	public void deleteSubCategory(String code) throws SQLException{
		client.delete("deleteSubCategoryByCode", code);
	}
	
	public void updateSubCategory(SubCategoryVO mvo) throws SQLException{
		client.update("updateSubCategory", mvo);
	}
	
	public ArrayList<SubCategoryVO> selectSubCategory() throws SQLException{
		return (ArrayList<SubCategoryVO>)client.queryForList("selectSubCategory");
	}
}
